# coding=utf8

# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# NOTE: This class is auto generated by the jdcloud code generator program.

from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest


class CreateSnapshotPolicyRequest(JDCloudRequest):
    """
    创建快照策略
    """

    def __init__(self, parameters, header=None, version="v1"):
        super(CreateSnapshotPolicyRequest, self).__init__(
            '/regions/{regionId}/snapshotPolicy', 'POST', header, version)
        self.parameters = parameters


class CreateSnapshotPolicyParameters(object):

    def __init__(self,regionId, name, interval, effectiveTime, snapshotLifecycle, status):
        """
        :param regionId: 地域ID
        :param name: 策略名称
        :param interval: 策略执行周期，单位:秒，不小于12小时
        :param effectiveTime: 策略生效时间，格式`YYYY-MM-DDTHH:mm:ss+xx:xx`。如`2020-02-02T20:02:00+08:00`
        :param snapshotLifecycle: 快照保留时间，单位:秒，0:表示不删除
        :param status: 策略状态。1:启用 2:禁用
        """

        self.regionId = regionId
        self.name = name
        self.interval = interval
        self.effectiveTime = effectiveTime
        self.snapshotLifecycle = snapshotLifecycle
        self.contactInfo = None
        self.status = status

    def setContactInfo(self, contactInfo):
        """
        :param contactInfo: (Optional) 联系人信息
        """
        self.contactInfo = contactInfo

